<?php

/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| Here is where you can register all of the routes for an application.
| It's a breeze. Simply tell Laravel the URIs it should respond to
| and give it the controller to call when that URI is requested.
|
*/

Route::get('/', function () {
    return view('welcome');
});

Route::any('admin/login', 'Admin\LoginController@login');
Route::get('admin/code', 'Admin\LoginController@code');


Route::group([], function (){
    Route::get('admin/user/add', 'Admin\UserController@add');
    Route::post('admin/user/insert', 'Admin\UserController@insert');
    Route::get('admin/user/edit/{id}', 'Admin\UserController@edit');
    Route::post('admin/user/update', 'Admin\UserController@update');
    Route::get('admin/user/delete/{id}', 'Admin\UserController@delete');
    Route::get('admin/user/index', 'Admin\UserController@index');
    Route::get('admin/index', 'Admin\IndexController@index');
    Route::get('admin/info', 'Admin\IndexController@info');
    Route::get('admin/quit', 'Admin\LoginController@quit');
    Route::any('admin/pass', 'Admin\IndexController@pass');
    Route::resource('admin/category', 'Admin\CategoryController');
    //文章
    Route::resource('admin/article', 'Admin\ArticleController');

    //分类路由
    Route::resource('admin/cate', 'Admin\CatesController');
    //标签路由
    Route::resource('admin/tag', 'Admin\TagController');
});

Route::group([], function(){
    Route::get('/', 'Home\IndexController@index');
    Route::get('/detail/{art_id}', 'Home\IndexController@detail');
});

